<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Send response</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.redirect.html">HttpResponse::redirect</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setbuffersize.html">HttpResponse::setBufferSize</a></div>
 <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="httpresponse.send" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">HttpResponse::send</h1>
  <p class="verinfo">(PECL pecl_http &gt;= 0.10.0)</p><p class="refpurpose"><span class="refname">HttpResponse::send</span> &mdash; <span class="dc-title">Send response</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-httpresponse.send-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">static</span>
   <span class="type">bool</span> <span class="methodname"><strong>HttpResponse::send</strong></span>
    ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$clean_ob</code><span class="initializer"> = true</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Finally send the entity.
  </p>
  <p class="para">
   A successful caching attempt will exit PHP, and write a log entry if the <a href="http.configuration.html" class="link">INI 设置</a>
   <a href="" class="link">http.log.cache</a> is set.
   要知道“出口”的含义请查阅
<a href="http.configuration.html" class="link">INI 设置</a>
<a href="" class="link">http.force_exit</a>。
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-httpresponse.send-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">clean_ob</code></em></dt>

     <dd>

      <p class="para">
       whether to destroy all previously started output handlers and their buffers
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-httpresponse.send-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 

 


 <div class="refsect1 examples" id="refsect1-httpresponse.send-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4264">
    <p><strong>Example #1 A <span class="function"><strong>HttpResponse::send()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setCache</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setContentType</span><span style="color: #007700">(</span><span style="color: #DD0000">'application/pdf'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setContentDisposition</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$user</span><span style="color: #DD0000">.pdf"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setFile</span><span style="color: #007700">(</span><span style="color: #DD0000">'sheet.pdf'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">send</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>



 <div class="refsect1 seealso" id="refsect1-httpresponse.send-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="httpresponse.capture.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::capture()</a> - Capture script output</span></li>
   </ul>
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.redirect.html">HttpResponse::redirect</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setbuffersize.html">HttpResponse::setBufferSize</a></div>
 <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
